package com.lm.easy.rule;

import org.jeasy.rules.annotation.*;

@Rule(name = "AdultAndRegisteredRule")
public class AdultAndRegisteredRule {

    @Condition
    public boolean check(@Fact("age") int age, @Fact("registered") boolean registered) {
        return age >= 18 && registered;
    }

    @Action
    public void allowAccess() {
        System.out.println("用户成年且已注册，允许访问系统 ✅");
    }
}